<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/18 0018
 * Time: 16:37
 */
namespace App\Http\Controllers;
use App\Http\Requests\StoreRequest;
use Illuminate\Support\Facades\DB;

class AgencyController extends  BaseController{
    public function index(StoreRequest $request){
       // echo '22';
        $request = $request->all();
        $map = array();
        isset($request['agency_name']) ? $map['agency_name'] = $request['agency_name'] : '';
        isset($request['user_name']) ? $map['user_name'] = $request['user_name'] : '';

        $lists = DB::table('agency')->where($map)->paginate(1);
        return view('agency.index',['lists'=>$lists]);
    }
}